﻿using System.Configuration.Provider;
using NCMIS.ObjectModel;

namespace NCMIS.Provider
{
    /// <summary>
    /// Provides the base implementation for the Policy Provider for the Policy Services.
    /// </summary>
    public abstract class PolicyProviderBase : ProviderBase
    {
        /// <summary>
        /// Applies a specified policy to an object.
        /// </summary>
        /// <param name="repositoryId">The id of the repository.</param>
        /// <param name="policyId">The id of the policy, to be applied.</param>
        /// <param name="objectId">The id of the object, on which to apply the policy.</param>
        public abstract void ApplyPolicy(string repositoryId, string policyId, string objectId);

        /// <summary>
        /// Removes a specified policy from an object.
        /// </summary>
        /// <param name="repositoryId">The id of the repository.</param>
        /// <param name="policyId">The id of the policy.</param>
        /// <param name="objectId">The id of the object.</param>
        public abstract void RemovePolicy(string repositoryId, string policyId, string objectId);

        /// <summary>
        /// Gets the list of policies currently applied to the specified object.
        /// </summary>
        /// <param name="repositoryId">The id of the repository.</param>
        /// <param name="objectId">The id of the object.</param>
        /// <param name="filter">Value indicating which properties for Objects that must be returned. (Optional, default: Not set)</param>
        /// <returns>List of policies.</returns>
        public abstract CmisObjects GetAppliedPolicies(string repositoryId, string objectId, string filter);
    }
}
